import cc from '@/components/bigScreen/js/commonConfig'

export default {
  /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

  leadCharts: {
    SetOptionForPie1: function() {
      return {
        color: cc.colors.standard,
        tooltip: {
          trigger: 'item',
          formatter: '{a}<br/>{b}:{c}({d}%)',
          confine: true,
          extraCssText: 'z-index:99999999',
        },
        legend: {
          orient: 'vertical',
          x: 'left',
          data: ['现状数据', '规划数据', '管理数据', '人口经济'],
          textStyle: {
            color: '#75bcf7'
          }
        },
        textStyle: {
          color: '#75bcf7'
        },
        series: [
          {
            name: '数据统计',
            type: 'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
              normal: {
                show: false,
                position: 'center'
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSise: '30',
                  fontWeight: 'bold'
                }
              }
            },
            labelLine: {
              normal: {
                show: false
              }
            },
            data: [
              { value: 50, name: '现状数据' },
              { value: 40, name: '规划数据' },
              { value: 5, name: '管理数据' },
              { value: 20, name: '人口经济' }
            ]
          }
        ]
      }
    },
    SetOptionForPie2: function() {
      return {
        color: cc.colors.standard,
        tooltip: {
          trigger: 'item',
          formatter: '{a}<br/>{b}:{c}({d}%)'
        },
        legend: {
          orient: 'vertical',
          x: 'left',
          data: ['现状数据', '规划数据', '管理数据', '人口经济'],
          textStyle: {
            color: '#75bcf7'
          }
        },
        textStyle: {
          color: '#75bcf7'
        },
        series: [
          {
            name: '数据统计',
            type: 'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
              normal: {
                show: false,
                position: 'center'
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSise: '30',
                  fontWeight: 'bold'
                }
              }
            },
            labelLine: {
              normal: {
                show: false
              }
            },
            data: [
              { value: 50, name: '现状数据' },
              { value: 40, name: '规划数据' },
              { value: 5, name: '管理数据' },
              { value: 20, name: '人口经济' }
            ]
          }
        ]
      }
    },
    SetOptionForBar1: function() {
      return {
        color: cc.colors.standard,
        tooltip: {},
        legend: {
          textStyle: {
            color: '#75bcf7'
          }
        },
        textStyle: {
          color: '#75bcf7'
        },
        dataset: {
          source: [
            ['year', '2015', '2016', '2017', '2018', '2019'],
            ['gdp', 10000, 12000, 13500, 15700, 17400],
            ['总人口', 1020, 1050, 1060, 1100, 1080],
            ['城市人口', 540, 530, 535, 530, 520]
          ]
        },
        xAxis: [
          { type: 'category', gridIndex: 0 },
          { type: 'category', gridIndex: 1 }
        ],
        yAxis: [
          { gridIndex: 0 },
          { gridIndex: 1 }
        ],
        grid: [
          { bottom: '55%' },
          { top: '55%' }
        ],
        series: [
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 }
        ]
      }
    },
    SetOptionForBar2: function() {
      return {
        color: cc.colors.standard,
        tooltip: {},
        legend: {
          textStyle: {
            color: '#75bcf7'
          }
        },
        textStyle: {
          color: '#75bcf7'
        },
        dataset: {
          source: [
            ['year', '2015', '2016', '2017', '2018', '2019'],
            ['gdp', 10000, 12000, 13500, 15700, 17400],
            ['总人口', 1020, 1050, 1060, 1100, 1080],
            ['城市人口', 540, 530, 535, 530, 520]
          ]
        },
        xAxis: [
          { type: 'category', gridIndex: 0 },
          { type: 'category', gridIndex: 1 }
        ],
        yAxis: [
          { gridIndex: 0 },
          { gridIndex: 1 }
        ],
        grid: [
          { bottom: '55%' },
          { top: '55%' }
        ],
        series: [
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', seriesLayoutBy: 'row' },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 },
          { type: 'bar', xAxisIndex: 1, yAxisIndex: 1 }
        ]
      }
    }
  },
  pieCharts: {
    SetOptionForPieCharts: function(option) {
      var titleText = option.title ? option.title : ''
      var color = option.color ? option.color : color.greenRed
      var legend = {
        orient: 'horizontal',
        x: '',
        y: '',
        selected: {},
        color:'#ffffff',
        show:false,
      }
      if (option.legend) {
        legend.orient = option.legend.orient ? option.legend.orient : legend.orient
        legend.x = option.legend.x ? option.legend.x : legend.x
        legend.y = option.legend.y ? option.legend.y : legend.y
        legend.selected = option.legend.selected ? option.legend.selected : legend.selected
        legend.color = option.legend.color ? option.legend.color : legend.color
        legend.show = option.legend.show ? option.legend.show : legend.show
      }
      var legendData = [], seriesData = []
      var itemType = 'pie'
      if (option.series && option.series.length > 0) {
        var series = option.series
        for (var i in series) {
          var item = series[i]
          var seriesItem = {
            center: item.center ? item.center : ['50%', '50%'],
            radius: item.radius ? item.radius : '70%',
            avoidLabelOverlap: false,
            type: item.type ? item.type : itemType,
            data: item.data ? item.data : []
          }
          if (item.labelLineShow) {
            seriesItem.label = {
              // formatter: "{b}:{d}%"
              formatter: '{b}'
            }
            seriesItem.labelLine = {
              length2: 5
            }
          } else {
            seriesItem.label = {
              normal: {
                show: false
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSise: '30',
                  fontWeight: 'bold'
                }
              }
            }
            seriesItem.labelLine = {
              normal: {
                show: false
              }
            }
          }
          if (item.name) {
            seriesItem.name = item.name
          }
          if (item.data) {
            for (var j in item.data) {
              var legendName = item.data[j].name
              if (legendName) {
                legendData.push(legendName)
              }
            }
          }
          seriesData.push(seriesItem)
        }
      }
      return {
        title: {
          show: titleText ? true : false,
          text: titleText,
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: color,
        tooltip: {
          trigger: 'item',
          //formatter: "{a}<br/>{b}:{d}%",
          formatter: '{a}<br/>{b}：{c} ({d}%)',
          extraCssText: 'z-index:99999999',
          confine: true
        },
        legend: {
          textStyle: {
            color: legend.color
          },
          orient: legend.orient,
          x: legend.x,
          y: legend.y,
          data: legendData,
          show: legend.show,
          type: 'scroll',
          selected: legend.selected
        },
        series: seriesData
      }
    },
    /*
     * 人口构成比例
     */
    SetOptionForPie_rkgcbl: function() {
      return {
        title: {
          text: '人口结构',
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: cc.colors.highBlue,
        tooltip: {
          trigger: 'item',
          formatter: '{a}<br/>{b}:{d}%'
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          orient: 'vertical',
          y: 'bottom',
          data: ['城镇人口', '农村人口']
        },
        series: [
          {
            name: '人口结构',
            type: 'pie',
            center: ['50%', '40%'],
            radius: '50%',
            avoidLabelOverlap: false,
            label: false,
            data: [
              { value: 39, name: '城镇人口' },
              { value: 61, name: '农村人口' }
            ]
          }
        ]
      }
    },
    /*
     * 人口年龄段比例
     */
    SetOptionForPie_rknldbl: function() {
      return {
        title: {
          text: '年龄段比例',
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: cc.colors.standard,
        tooltip: {
          trigger: 'item',
          formatter: '{a}<br/>{b}:{d}%'
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          orient: 'vertical',
          y: 'bottom',
          data: ['0-15岁', '16-59岁', '60岁以上']
        },
        textStyle: {
          color: '#fff'
        },
        series: [
          {
            name: '年龄段比例',
            type: 'pie',
            center: ['50%', '40%'],
            radius: ['35%', '50%'],
            avoidLabelOverlap: false,
            label: {
              normal: {
                show: false,
                position: 'center'
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSise: '30',
                  fontWeight: 'bold'
                }
              }
            },
            labelLine: {
              normal: {
                show: false
              }
            },
            data: [
              { value: 25, name: '0-15岁' },
              { value: 48, name: '16-59岁' },
              { value: 27, name: '60岁以上' }
            ]
          }
        ]
      }
    },
    /*
     * 产业经济构成比例
     */
    SetOptionForPie_cyjjgcbl: function() {
      return {
        color: cc.colors.highBlue,
        tooltip: {
          trigger: 'item',
          formatter: '{a}<br/>{b}:{d}%'
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          orient: 'vertical',
          y: 'bottom',
          x: 'right',
          data: ['第一产业', '第二产业', '第三产业']
        },
        series: [
          {
            name: '产业构成比例',
            type: 'pie',
            radius: '70%',
            avoidLabelOverlap: false,
            label: {
              formatter: '{b}:{d}%'
            },
            labelLine: {
              length2: 5
            },
            data: [
              { value: 39, name: '第一产业' },
              { value: 42, name: '第二产业' },
              { value: 19, name: '第三产业' }
            ]
          }
        ]
      }
    }
  },
  ringCharts: {
    SetOptionForRingCharts: function(option) {
      var titleText = option.title ? option.title : ''
      var color = option.color ? option.color : color.greenRed
      var legend = {
        orient: 'horizontal',
        x: '',
        y: '',
        color:'#ffffff',
        show:false,
      }
      if (option.legend) {
        legend.orient = option.legend.orient ? option.legend.orient : legend.orient
        legend.x = option.legend.x ? option.legend.x : legend.x
        legend.y = option.legend.y ? option.legend.y : legend.y
        legend.color = option.legend.color ? option.legend.color : legend.color
        legend.show = option.legend.show ? option.legend.show : legend.show
      }
      var legendData = [], seriesData = []
      var itemType = 'pie'
      if (option.series && option.series.length > 0) {
        var series = option.series
        for (var i in series) {
          var item = series[i]
          var seriesItem = {
            center: item.center ? item.center : ['50%', '50%'],
            radius: item.radius ? item.radius : ['35%', '65%'],
            avoidLabelOverlap: false,
            type: item.type ? item.type : itemType,
            data: item.data ? item.data : [],
            itemStyle: {
              borderRadius: 10,
              borderColor: '#fff',
              borderWidth: 2
            }
          }
          if (item.labelLineShow) {
            seriesItem.label = {
              // formatter: '{b}:{d}%'
              formatter: '{b}'
            }
            seriesItem.labelLine = {
              length2: 5
            }
          } else {
            seriesItem.label = {
              normal: {
                show: false,
                position: 'center'
              },
              emphasis: {
                show: true,
                textStyle: {
                  fontSise: '30',
                  fontWeight: 'bold'
                }
              }
            }
            seriesItem.labelLine = {
              normal: {
                show: false
              }
            }
          }
          if (item.name) {
            seriesItem.name = item.name
          }

          if (item.data) {
            for (var j in item.data) {
              var legendName = item.data[j].name
              if (legendName) {
                legendData.push(legendName)
              }
            }
          }
          seriesData.push(seriesItem)
        }
      }
      return {
        title: {
          show: titleText ? true : false,
          text: titleText,
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: color,
        tooltip: {
          trigger: 'item',
          //formatter: "{a}<br/>{b}:{d}%"
          formatter: '{a}<br/>{b}：{c} ({d}%)',
          extraCssText: 'z-index:99999999',
          confine: true
        },
        legend: {
          textStyle: {
            color: legend.color
          },
          orient: legend.orient,
          x: legend.x,
          y: legend.y,
          data: legendData,
          show: legendData.length > 0 ? true : false
        },
        textStyle: {
          color: '#fff'
        },
        series: seriesData
      }
    }
  },
  liquidfillCharts: {
    SetOptionForLiquidfillCharts: function(option) {
      var color = option.color ? option.color : color.greenRed
      var data = option.data ? option.data : [0.47, 0.42, 0.37]
      return {
        series: [{
          color: color,
          type: 'liquidFill',
          data: data,
          //center: ['50%', '60%'],
          radius: '80%',
          outline: {
            show: false
          },
          backgroundStyle: {
            color: '#0d1836'
          },
          label: {
            color: '#fff',
            fontSize: 24,
            fontFamily: 'Lobster Two',
            baseline: 'bottom'
          }
        }]
      }
    },
    SetOptionForLiquidfillCharts_st: function() {
      return {
        series: [{
          color: cc.colors.greenRed,
          type: 'liquidFill',
          data: [0.47, 0.42, 0.37],
          //center: ['50%', '60%'],
          radius: '80%',
          outline: {
            show: false
          },
          backgroundStyle: {
            color: '#0d1836'
          },
          label: {
            color: '#fff',
            fontSize: 24,
            fontFamily: 'Lobster Two',
            baseline: 'bottom'
          }
        }]
      }
    },
    SetOptionForLiquidfillCharts_cz: function() {
      return {
        series: [{
          color: cc.colors.redHigh,
          type: 'liquidFill',
          data: [0.55, 0.45, 0.35],
          //center: ['50%', '60%'],
          radius: '80%',
          outline: {
            show: false
          },
          backgroundStyle: {
            color: '#0d1836'
          },
          label: {
            color: '#fff',
            fontSize: 24,
            fontFamily: 'Lobster Two',
            baseline: 'bottom'
          }
        }]
      }
    },
    SetOptionForLiquidfillCharts_ny: function() {
      return {
        series: [{
          color: cc.colors.yellowHigh,
          type: 'liquidFill',
          data: [0.70, 0.60, 0.50],
          //center: ['50%', '60%'],
          radius: '80%',
          outline: {
            show: false
          },
          backgroundStyle: {
            color: '#0d1836'
          },
          label: {
            color: '#fff',
            fontSize: 24,
            fontFamily: 'Lobster Two',
            baseline: 'bottom'
          }
        }]
      }
    }
  },
  ringPercentCharts: {
    SetOptionForRingPercentCharts: function(option) {
      var titleText = option.title ? option.title : ''
      var color = option.color ? option.color : cc.colors.standard2
      var data = option.data ? option.data[0] : {}
      var name = 'name'
      var value = 50
      if (data) {
        name = data.name ? data.name : name
        value = data.value ? data.value : value
      }
      return {
        title: {
          show: titleText ? true : false,
          text: titleText,
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: color,
        series: [{
          name: name,
          type: 'pie',
          radius: ['60%', '75%'],
          avoidLabelOverlap: false,
          hoverAnimation: false,
          label: {
            normal: {
              color: '#fff',
              show: false,
              position: 'center',
              textStyle: {
                fontSize: 14
              },
              formatter: function(params) {
                if (params.seriesName) {
                  return params.seriesName + '\n' + params.value + '%'
                } else {
                  return params.value + '%'
                }
              }
            }
          },
          data: [
            {
              value: value,
              name: name,
              label: {
                normal: {
                  show: true
                }
              }
            }, {
              value: 100 - value,
              name: ''
            }]
        }]
      }
    },
    SetOptionForRingPercent: function(name, value) {
      return {
        color: cc.colors.standard2,
        series: [{
          name: name,
          type: 'pie',
          radius: ['60%', '75%'],
          avoidLabelOverlap: false,
          hoverAnimation: false,
          label: {
            normal: {
              color: '#fff',
              show: false,
              position: 'center',
              textStyle: {
                fontSize: 14
              },
              formatter: function(params) {
                if (params.seriesName) {
                  return params.seriesName + '\n' + params.value + '%'
                } else {
                  return params.value + '%'
                }
              }
            }
          },
          data: [
            {
              value: value,
              name: name,
              label: {
                normal: {
                  show: true
                }
              }
            }, {
              value: 100 - value,
              name: ''
            }]
        }]
      }
    }
  },
  barCharts: {
    /*
     * 根据配置信息返回图表配置
     * @param {type} option
     * @returns {undefined}
     */
    SetOptionForBarCharts: function(option) {
      var titleText = option.title ? option.title : ''
      var color = option.color ? option.color : color.greenRed
      var legend = {
        orient: 'horizontal',
        x: '',
        y: '',
        selected: {},
        color:'#ffffff',
        show:false,
      }
      if (option.legend) {
        legend.orient = option.legend.orient ? option.legend.orient : legend.orient
        legend.x = option.legend.x ? option.legend.x : legend.x
        legend.y = option.legend.y ? option.legend.y : legend.y
        legend.selected = option.legend.selected ? option.legend.selected : legend.selected
        legend.color = option.legend.color ? option.legend.color : legend.color
        legend.show = option.legend.show ? option.legend.show : legend.show
      }
      var axisType = 'x'
      var axisName = ''
      var axisData = []
      var splitLine = {
        lineStyle: {
          color: cc.colors.standard2[0],
          type: 'dotted'
        }
      }
      if (option.axis) {
        axisType = option.axis.axisType ? option.axis.axisType : axisType
        axisName = option.axis.name ? option.axis.name : axisName
        axisData = option.axis.data ? option.axis.data : axisData
        splitLine = option.axis.splitLine ? option.axis.splitLine : splitLine
      }
      var axisCatagory = {
        nameTextStyle: {
          color: option.axis.color ? option.axis.color : '#fff'
        },
        "axisLabel":{
          interval: 0,
          rotate:option.axis.rotate ? option.axis.rotate : 0
        },
        axisLine: {
          lineStyle: {
            color: option.axis.color ? option.axis.color : '#fff'
          }
        },
        type: 'category',
        data: axisData
      }
      var axisValue = {
        nameTextStyle: {
          color: option.axis.color ? option.axis.color : '#fff'
        },
        axisLine: {
          lineStyle: {
            color: option.axis.color ? option.axis.color : '#fff'
          }
        },

        type: 'value',
        splitLine: splitLine
      }
      var labelPosition = 'top'
      var xAxis = {}, yAxis = {}
      switch (axisType) {
        case 'x':
          xAxis = axisCatagory
          yAxis = axisValue
          labelPosition = 'top'
          break
        case 'y':
          xAxis = axisValue
          yAxis = axisCatagory
          labelPosition = 'right'
          break
      }
      yAxis.name = axisName
      var legendData = [], seriesData = []
      var itemType = 'bar'
      if (option.series && option.series.length > 0) {
        var series = option.series
        for (var i in series) {
          var item = series[i]
          var seriesItem = {
            type: item.type ? item.type : itemType,
            data: item.data ? item.data : []
          }
          if (item.name) {
            legendData.push(item.name)
            seriesItem.name = item.name
          }
          //柱子的宽度
          if(item.barMaxWidth){
            seriesItem.barMaxWidth=item.barMaxWidth
          }
          if (item.stack) {
            seriesItem.stack = item.stack
          }
          if (item.label) {
            if (item.label.show) {
              seriesItem.label = {
                color: option.label.color ? option.label.color : '#fff',
                show: true,
                position: labelPosition
              }
            }
          }
          seriesData.push(seriesItem)
        }
      }

      return {
        title: {
          show: titleText ? true : false,
          text: titleText,
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: option.label.color ? option.label.color : '#fff'
          }
        },
        color: color,
        tooltip: {
          trigger: 'axis',
          axisPointer: { type: 'shadow' },
          extraCssText: 'z-index:99999999',
          confine: true
        },
        legend: {
          textStyle: {
            color: legend.color
          },
          orient: legend.orient,
          x: legend.x,
          y: legend.y,
          data: legendData,
          show:legend.show,
          //show: legendData.length > 0 ? true : false,
          type: 'scroll',
          selected: legend.selected
        },
        grid: {
          top:"10%",
          left: '3%',
          right: '3%',
          bottom: '0%',
          containLabel: true
        },
        xAxis: xAxis,
        yAxis: yAxis,
        series: seriesData
      }
    },
    /*
     * 土地开发利用
     */
    SetOptionForBar_tdkfly: function() {
      return {
        color: cc.colors.redHigh,
        tooltip: {
          trigger: 'axis',
          axisPointer: { type: 'shadow' }
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['以前', '2017年', '2018年', '2019年']
        },
        grid: {
          left: '3%',
          right: '10%',
          bottom: '3%',
          top: '20%',
          containLabel: true
        },
        xAxis: {
          name: '%',
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          type: 'value',
          max: 100
        },
        yAxis: {
          name: '类型',
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          type: 'category',
          data: ['商服用地', '住宅用地', '科教用地', '特殊用地', '耕地', '林地', '水利用地']
        },
        series: [
          {
            name: '以前',
            type: 'bar',
            stack: '占比',
            label: {
              show: true,
              position: 'insideRight'
            },
            data: [60, 50, 50, 40, 60, 70, 65]
          },
          {
            name: '2017年',
            type: 'bar',
            stack: '占比',
            label: {
              show: true,
              position: 'insideRight'
            },
            data: [10, 12, 10, 8, 8, 5, 4]
          },
          {
            name: '2018年',
            type: 'bar',
            stack: '占比',
            label: {
              show: true,
              position: 'insideRight'
            },
            data: [12, 10, 5, 5, 4, 6, 2]
          },
          {
            name: '2019年',
            type: 'bar',
            stack: '占比',
            label: {
              show: true,
              position: 'insideRight'
            },
            data: [8, 8, 10, 4, 2, 5, 3]
          }
        ]
      }
    },
    /*
     * 自然资源
     */
    SetOptionForBar_zrzy: function() {
      return {
        color: cc.colors.yellowHigh,
        tooltip: {
          trigger: 'axis',
          axisPointer: { type: 'shadow' }
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['2018年', '2019年']
        },
        grid: {
          left: '3%',
          right: '3%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          splitLine: {
            lineStyle: {
              color: cc.colors.standard2[0],
              type: 'dotted'
            }
          },
          type: 'value'
        },
        yAxis: {
          name: '单位：万公顷',
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          type: 'category',
          data: ['农田', '森林', '草地', '水域湿地', '居民地', '工矿']
        },
        series: [
          {
            name: '2018年',
            type: 'bar',
            label: {
              color: '#fff',
              show: true,
              position: 'right'
            },
            data: [450, 610, 220, 75, 50, 35]
          },
          {
            name: '2019年',
            type: 'bar',
            label: {
              color: '#fff',
              show: true,
              position: 'right'
            },
            data: [460, 640, 210, 76, 60, 40]
          }
        ]
      }
    },
    /*
     * 土地供应
     */
    SetOptionForBar_tdgy: function() {
      var mycolors = cc.colors.highBlue
      var data = {
        gymj: [245, 265, 380, 345, 420, 405, 351, 428, 540, 561],
        cjmj: [210, 180, 341, 265, 352, 378, 289, 398, 456, 478]
      }
      return {
        color: myColors,
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        toolbox: {
          show: false
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['供应面积', '成交面积']
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              alignWithLabel: true
            },
            nameTextStyle: {
              color: '#fff'
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            data: (function() {
              var res = []
              for (var i = 0; i <= 9; i++) {
                var year = 2010 + i
                res.push(year + '年')
              }
              return res
            })()
          }
        ],
        yAxis: [
          {
            type: 'value',
            name: '公顷',
            position: 'left',
            nameTextStyle: {
              color: myColors[0]
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            axisLabel: {
              formatter: '{value}'
            }
          }
        ],
        series: [
          {
            name: '供应面积',
            type: 'bar',
            data: data.gymj
          },
          {
            name: '成交面积',
            type: 'bar',
            data: data.cjmj
          }
        ]
      }
    },
    /*
     * 土地市场交易量走势
     */
    SetOptionForBar_tdscjylzs: function() {
      var myColors = cc.colors.highBlue
      var data = {
        gymj: [245, 265, 380, 345, 420, 405, 351, 428, 540, 561],
        cjmj: [210, 180, 341, 265, 352, 378, 289, 398, 456, 478],
        cjzs: [1244, 1841, 2654, 3874, 3425, 2786, 3024, 4012, 4265, 4365]
      }
      return {
        color: myColors,
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        grid: {
          right: '10%'
        },
        toolbox: {
          show: false
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['供求比', '成交宗数']
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              alignWithLabel: true
            },
            nameTextStyle: {
              color: '#fff'
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            data: (function() {
              var res = []
              for (var i = 0; i <= 9; i++) {
                var year = 2010 + i
                res.push(year + '年')
              }
              return res
            })()
          }
        ],
        yAxis: [
          {
            type: 'value',
            name: '供求比',
            position: 'left',
            nameTextStyle: {
              color: myColors[0]
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            axisLabel: {
              formatter: '{value}%'
            }
          },
          {
            type: 'value',
            name: '宗数（件）',
            position: 'right',
            nameTextStyle: {
              color: myColors[1]
            },
            axisLine: {
              lineStyle: {
                color: myColors[1]
              }
            },
            axisLabel: {
              formatter: '{value}'
            }
          }
        ],
        series: [
          {
            name: '供求比',
            type: 'line',
            data: (function() {
              let gqb = []
              for (let i = 0; i < data.gymj.length; i++) {
                var res = data.cjmj[index] / value * 100
                gqb.push(res.toFixed(2))
              }
              return gqb
            })()
          },
          {
            name: '成交宗数',
            type: 'line',
            yAxisIndex: 1,
            data: data.cjzs
          }
        ]
      }
    },
    /*
     * 产业经济产值总览
     */
    SetOptionForBar_cyjjczzl: function() {
      return {
        color: cc.colors.redHigh,
        tooltip: {
          trigger: 'axis',
          axisPointer: { type: 'shadow' }
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['第一产业', '第二产业', '第三产业']
        },
        grid: {
          left: '3%',
          right: '3%',
          bottom: '3%',
          top: '20%',
          containLabel: true
        },
        yAxis: {
          name: '亿元',
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          type: 'value'
        },
        xAxis: {
          name: '类型',
          nameTextStyle: {
            color: '#fff'
          },
          axisLine: {
            lineStyle: {
              color: '#fff'
            }
          },
          type: 'category',
          data: (function() {
            var res = []
            for (var i = 0; i <= 9; i++) {
              var year = 2010 + i
              res.push(year + '年')
            }
            return res
          })()
        },
        series: [
          {
            name: '第一产业',
            type: 'bar',
            stack: '总量',
            data: [2354, 2546, 2789, 3045, 3324, 3857, 4324, 4922, 5312, 5721]
          },
          {
            name: '第二产业',
            type: 'bar',
            stack: '总量',
            data: [2812, 3240, 3687, 4024, 4312, 4532, 4751, 5045, 5435, 5845]
          },
          {
            name: '第三产业',
            type: 'bar',
            stack: '总量',
            data: [1024, 1204, 1502, 1845, 2099, 2445, 2699, 2912, 3245, 3612]
          }
        ]
      }
    },
    /*
     * 采矿权登记数
     */
    SetOptionForBar_ckqdjs: function() {
      var myColors = cc.colors.highBlue
      var data = {
        ckqdjmj: [210, 180, 341, 265, 352, 378, 289, 398, 456, 478],
        ckqdjs: [345, 265, 380, 345, 420, 405, 351, 428, 540, 561]
      }
      return {
        color: myColors,
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        toolbox: {
          show: false
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          data: ['登记面积', '登记数']
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              alignWithLabel: true
            },
            nameTextStyle: {
              color: '#fff'
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            data: (function() {
              var res = []
              for (var i = 0; i <= 9; i++) {
                var year = 2010 + i
                res.push(year + '年')
              }
              return res
            })()
          }
        ],
        yAxis: [
          {
            type: 'value',
            name: '公顷',
            position: 'left',
            nameTextStyle: {
              color: myColors[0]
            },
            axisLine: {
              lineStyle: {
                color: myColors[0]
              }
            },
            axisLabel: {
              formatter: '{value}'
            }
          },
          {
            type: 'value',
            name: '件',
            position: 'right',
            nameTextStyle: {
              color: myColors[1]
            },
            axisLine: {
              lineStyle: {
                color: myColors[1]
              }
            },
            axisLabel: {
              formatter: '{value}'
            }
          }
        ],
        series: [
          {
            name: '登记面积',
            type: 'bar',
            data: data.ckqdjmj
          },
          {
            name: '登记数',
            yAxisIndex: 1,
            type: 'line',
            data: data.ckqdjs
          }
        ]
      }
    }
  },
  radarCharts: {
    SetOptionForRadarCharts: function(option) {
      var titleText = option.title ? option.title : ''
      var color = option.color ? option.color : color.greenRed
      var legend = {
        orient: 'horizonal',
        x: '',
        y: ''
      }
      if (option.legend) {
        legend.orient = option.legend.orient ? option.legend.orient : legend.orient
        legend.x = option.legend.x ? option.legend.x : legend.x
        legend.y = option.legend.y ? option.legend.y : legend.y
      }
      var axis = option.axis
      var radar = [
        {
          indicator: axis.data ? axis.data : [],
          radius: axis.radius ? axis.radius : '60%'
        }
      ]
      var legendData = [], seriesData = []
      if (option.series && option.series.length > 0) {
        var series = option.series
        for (var i in series) {
          var item = series[i]
          var seriesItem = {
            value: item.data ? item.data : []
          }
          if (item.name) {
            seriesItem.name = item.name
            legendData.push(item.name)
          }
          seriesData.push(seriesItem)
        }
      }
      return {
        title: {
          show: titleText ? true : false,
          text: titleText,
          left: 'center',
          textStyle: {
            fontSize: 14,
            color: '#fff'
          }
        },
        color: color,
        tooltip: {
          trigger: 'axis',
          extraCssText: 'z-index:99999999',
          confine: true
        },
        legend: {
          textStyle: {
            color: '#fff'
          },
          orient: legend.orient,
          x: legend.x,
          y: legend.y,
          data: legendData,
          show: legendData.length > 0 ? true : false
        },
        radar: radar,
        series: [
          {
            type: 'radar',
            tooltip: {
              trigger: 'item'
            },
            areaStyle: {},
            data: seriesData
          }
        ]
      }
    },
    SetOptionForRadar_atmosphereQuality: function(name) {
      return {
        color: cc.colors.yellowHigh,
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          show: false
        },
        radar: [
          {
            indicator: (function() {
              var res = []
              for (var i = 1; i <= 12; i++) {
                res.push({ text: i + '月', max: 500 })
              }
              return res
            })(),
            radius: '60%'
          }
        ],
        series: [
          {
            type: 'radar',
            tooltip: {
              trigger: 'item'
            },
            areaStyle: {},
            data: [
              {
                name: name,
                value: [251, 205, 178, 153, 143, 82, 61, 40, 70, 124, 310, 354]
              }
            ]
          }
        ]
      }
    },
    SetOptionForRadar_waterEnvironment: function(name) {
      return {
        color: cc.colors.yellowHigh,
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          show: false
        },
        radar: [
          {
            indicator: [
              { text: '降水量', max: 2000 },
              { text: '蒸发量', max: 2000 },
              { text: '地表径流', max: 100 },
              { text: '水源涵养', max: 100 },
              { text: '水质', max: 100 }
            ],
            radius: '60%'
          }
        ],
        series: [
          {
            type: 'radar',
            tooltip: {
              trigger: 'item'
            },
            areaStyle: {},
            data: [
              {
                name: name,
                value: [1500, 1200, 78, 60, 90]
              }
            ]
          }
        ]
      }
    },
    SetOptionForRadar_soilQuality: function(name) {
      return {
        color: cc.colors.yellowHigh,
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          show: false
        },
        radar: [
          {
            indicator: [
              { text: '植被覆盖率', max: 100 },
              { text: '防风固沙', max: 100 },
              { text: '水土保持', max: 100 },
              { text: '沙化', max: 100 },
              { text: '石漠化', max: 100 },
              { text: '盐渍化', max: 100 }
            ],
            radius: '60%'
          }
        ],
        series: [
          {
            type: 'radar',
            tooltip: {
              trigger: 'item'
            },
            areaStyle: {},
            data: [
              {
                name: name,
                value: [44, 60, 50, 20, 5, 0]
              }
            ]
          }
        ]
      }
    },
    SetOptionForRadar_biodiversity: function(name) {
      return {
        color: cc.colors.yellowHigh,
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          show: false
        },
        radar: [
          {
            indicator: [
              { text: '数量', max: 100 },
              { text: '面积', max: 100 },
              { text: '物种量', max: 100 },
              { text: '植被生产力', max: 100 },
              { text: 'NDVI', max: 100 }
            ],
            radius: '60%'
          }
        ],
        series: [
          {
            type: 'radar',
            tooltip: {
              trigger: 'item'
            },
            areaStyle: {},
            data: [
              {
                name: name,
                value: [30, 50, 40, 60, 70, 45]
              }
            ]
          }
        ]
      }
    }
  },
  gaugeCharts: {
    SetOptionForGaugeCharts: function(option) {
      var data = option.series ? option.series : []
      return {
        tooltip: {
          formatter: '{a}<br />{b} : {c}%'
        },
        series: [
          {
            name: '指标',
            type: 'gauge',
            radius: '80%',
            axisLine: {
              lineStyle: {
                color: [[0.09, 'lime'], [0.82, '#1e90ff'], [1, '#ff4500']],
                width: 3,
                shadowColor: '#fff',
                shadowBlur: 10
              }
            },
            axisLabel: {
              fontWeight: 'bolder',
              color: '#fff'
            },
            axisTick: {
              length: 10,
              lineStyle: {
                color: 'auto'
              }
            },
            splitLine: {
              length: 15
            },
            pointer: {
              length: '80%',
              width: 2
            },
            title: {
              textStyle: {
                fontWeight: 'bolder',
                fontSize: 14,
                color: '#fff'
              }
            },
            detail: {
              offsetCenter: [0, '70%'],
              formatter: '{value}%',
              textStyle: {
                fontWeight: 'bolder',
                fontSize: 20
              }
            },
            data: data
          }
        ]
      }
    },
    /*
     * 新增建设用地指标使用
     */
    SetOptionForgauge_xzjsydzbsy: function() {
      return {
        tooltip: {
          formatter: '{a}<br />{b} : {c}%'
        },
        series: [
          {
            name: '指标',
            type: 'gauge',
            radius: '80%',
            axisLine: {
              lineStyle: {
                color: [[0.09, 'lime'], [0.82, '#1e90ff'], [1, '#ff4500']],
                width: 3,
                shadowColor: '#fff',
                shadowBlur: 10
              }
            },
            axisLabel: {
              fontWeight: 'bolder',
              color: '#fff'
            },
            axisTick: {
              length: 10,
              lineStyle: {
                color: 'auto'
              }
            },
            splitLine: {
              length: 15
            },
            pointer: {
              length: '80%',
              width: 2
            },
            title: {
              textStyle: {
                fontWeight: 'bolder',
                fontSize: 14,
                color: '#fff'
              }
            },
            detail: {
              offsetCenter: [0, '70%'],
              formatter: '{value}%',
              textStyle: {
                fontWeight: 'bolder',
                fontSize: 20
              }
            },
            data: [{ value: 70, name: '使用率' }]
          }
        ]
      }
    }
  }
}
